/*
 * @Description:
 * @Author: Zzt
 * @Date: 2022-11-10 16:51:31
 * @LastEditTime: 2022-12-07 15:53:07
 */
import {
  SET_AT_LIST,
  SET_PERIOD_LIST,
  SET_STORAGE_LIST,
  SET_FILE_TYPE,
  SET_STORAGE_FORMAT,
  SET_PERIOD,
  SET_CATEGORY,
  SET_PERMISS,
  SET_UNIT,
  SET_TIME,
  SET_SECRET
} from '../constants';

export const FamilyStatisticsReducer = (state, action) => {
  switch (action.type) {
    case SET_AT_LIST: {
      return {
        ...state,
        ATList: action.data
      };
    }
    case SET_PERIOD_LIST:
      return { ...state, periodList: action.data };
    case SET_STORAGE_LIST:
      return { ...state, storageList: action.data };

    case SET_FILE_TYPE:
      return { ...state, fileTypeList: action.data };
    case SET_STORAGE_FORMAT:
      return { ...state, storageFormatList: action.data };
    case SET_PERIOD:
      return { ...state, retentionPeriodList: action.data };
    case SET_CATEGORY:
      return { ...state, categoryList: action.data };
    case SET_PERMISS:
      return { ...state, permissList: action.data };
    case SET_UNIT:
      return { ...state, unitList: action.data };
    case SET_TIME:
      return { ...state, timeList: action.data };
    case SET_SECRET:
      return { ...state, secretList: action.data };
    default:
      console.log('untouched', action);
      return state;
  }
};
